package org.come.Jpanel;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import org.come.login.LoginMouslisten;
import org.come.login.SpriteBtn;

public class ExitGameTipJpanel extends JPanel {
	
	private SpriteBtn btnExit;
	private JLabel labtip;
	public ExitGameTipJpanel() {
	
		//键盘监听
		this.setPreferredSize(new Dimension(426,164));
		this.setLayout(null);
		this.setBackground(new Color(0,0,0,0));
		this.setOpaque(false);
		
		labtip = new JLabel();
		labtip.setText("您的账号已经在其他地方登录！(已掉线)");
		labtip.setForeground(Color.WHITE);
		labtip.setFont(new Font("宋体", Font.BOLD, 14));
		labtip.setHorizontalTextPosition(SwingConstants.CENTER);
		labtip.setHorizontalAlignment(SwingConstants.CENTER);
		labtip.setBackground(new Color(0,0,0,0));
		labtip.setBounds(70, 40, 300, 40);
		this.add(labtip);
		
		btnExit = new SpriteBtn("resource/NewUi/按钮_确定2", 110, 90, false);
		btnExit.setBounds( 110, 90, 188, 35);
		btnExit.addMouseListener(new LoginMouslisten(-1,btnExit,null));
		this.add(btnExit);				
	}
	private ImageIcon icon;
	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		if (icon==null) {
            icon=new ImageIcon("inkImg/hongmu/2/消息提示框背景.png");
        }
		g.drawImage(icon.getImage(), 0, 0, 426, 164, null);
		btnExit.draw(g);
	}

	public SpriteBtn getBtnExit() {
		return btnExit;
	}

	public void setBtnExit(SpriteBtn btnExit) {
		this.btnExit = btnExit;
	}

	public JLabel getLabtip() {
		return labtip;
	}

	public void setLabtip(JLabel labtip) {
		this.labtip = labtip;
	}

}
